public class DNode implements Position{

    private Object element;
    private DNode prev;
    private DNode next;

    public DNode(Object el, DNode pr, DNode nx){
	setElement(el);
	setPrev(pr);
	if (prev != null) pr.setNext(this);
    	setNext(nx);
	if (next != null) nx.setPrev(this);
    }

    public void setElement(Object el){
		element = el;
	}

    public void setNext(DNode nx){
     	next = nx;
    }
	public void setPrev(DNode pr){
     	prev = pr;
    }

    public Object element(){
    	return element;
    }

   public DNode prev(){
    	return prev;
    }

    public DNode next(){
    	return next;
    }

    public String toString(){
    	return "<DNode(" + element + ")>";
    }
}